import {
	axios
} from "./axios.js";


// 获取当前省份的城市列表
export const getCityList = () => {
	return axios({
		url: '/dynamic/getCityList',
		method: 'get',
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}


// 获取话题列表和用户列表
export const getTopicAndUsers = () => {
	return axios({
		url: '/dynamic/getTopicAndUsers',
		method: 'get',
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}


// 点击保存为草稿
export const saveDraft = (data) => {
	return axios({
		url: '/dynamic/saveDraft',
		method: 'post',
		data: data,
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}

// 发布笔记
export const releaseNote = (data) => {
	// console.log(data);
	return axios({
		url: '/dynamic/releaseNote',
		method: 'post',
		data: data,
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}



// 始调用后端把数据库里面的用户背景地址更新
export const updateUserBg = (data) => {
	return axios({
		url: '/user/updateUserBg',
		method: 'post',
		data: data,
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}


// 从后端获取临时凭证
export const getStsToken = () => {
	return axios({
		url: '/alioss/getOssStsToken',
		method: 'get',
		headers: {
			token: uni.getStorageSync("token")
		}
	})
}